import request from '/@/utils/request'

// 查询列表
export function listLkSelectrule(query:any) {
  return request({
    url: '/rule/list',
    method: 'get',
    params: query
  })
}
// 查询详细
export function getLkSelectrule(ruleID:any) {
  return request({
    url: '/rule/get',
    method: 'get',
    params: {
      id: ruleID.toString()
    }
  })
}
// 新增
export function addLkSelectrule(data:any) {
  return request({
    url: '/rule/add',
    method: 'post',
    data: data
  })
}
// 修改
export function updaterule(data:any,id:any) {
  return request({
    url: '/rule/edit/' + id,
    method: 'put',
    data: data
  })
}
// 删除
export function delrule(ruleIDs:any) {
  return request({
    url: '/rule/delete/'+ruleIDs,
    method: 'delete'
  })
}
// 查询列表
export function listLkSelectrulefield(query:any) {
  return request({
    url: '/rulefield/list',
    method: 'get',
    params: query
  })
}
// 查询详细
export function getLkSelectrulefield(ruleFieldID:any) {
  return request({
    url: '/rulefield/get',
    method: 'get',
    params: {
      id: ruleFieldID.toString()
    }
  })
}
// 新增
export function addLkSelectrulefield(data:any) {
  return request({
    url: '/rulefield/add',
    method: 'post',
    data: data
  })
}
// 修改
export function updateLkSelectrulefield(data:any) {
  return request({
    url: '/rulefield/edit',
    method: 'put',
    data: data
  })
}
// 删除
export function delLkSelectrulefield(ruleFieldIDs:any) {
  return request({
    url: '/rulefield/delete',
    method: 'delete',
    data: {
      ids: ruleFieldIDs
    }
  })
}
// 查询列表
export function listLkUpdaterule(query:any) {
  return request({
    url: '/system/lkUpdaterule/list',
    method: 'get',
    params: query
  })
}
// 查询详细
export function getLkUpdaterule(ruleID:any) {
  return request({
    url: '/system/lkUpdaterule/get',
    method: 'get',
    params: {
      id: ruleID.toString()
    }
  })
}
// 新增
export function addLkUpdaterule(data:any) {
  return request({
    url: '/system/lkUpdaterule/add',
    method: 'post',
    data: data
  })
}
// 修改
export function updateLkUpdaterule(data:any,id:any) {
  return request({
    url: '/system/lkUpdaterule/edit/'+id,
    method: 'put',
    data: data
  })
}
// 删除
export function delLkUpdaterule(ruleIDs:any) {
  return request({
    url: '/system/lkUpdaterule/delete',
    method: 'delete',
    data:{
      ids:ruleIDs
    }
  })
}
// 查询列表
export function listLkUpdaterulefield(query:any) {
  return request({
    url: '/system/lkUpdaterulefield/list',
    method: 'get',
    params: query
  })
}
// 查询详细
export function getLkUpdaterulefield(ruleFieldID:any) {
  return request({
    url: '/system/lkUpdaterulefield/get',
    method: 'get',
    params: {
      id: ruleFieldID.toString()
    }
  })
}
// 新增
export function addLkUpdaterulefield(data:any) {
  return request({
    url: '/system/lkUpdaterulefield/add',
    method: 'post',
    data: data
  })
}
// 修改
export function updateLkUpdaterulefield(data:any) {
  return request({
    url: '/system/lkUpdaterulefield/edit',
    method: 'put',
    data: data
  })
}
// 删除
export function delLkUpdaterulefield(ruleFieldIDs:any) {
  return request({
    url: '/system/lkUpdaterulefield/delete',
    method: 'delete',
    data:{
      ids:ruleFieldIDs
    }
  })
}
export function testsql(sql:any,db:any) {
  return request({
    url: '/templates/testsql',
    method: 'post',
    data:{
      sql:sql,
      db:db,
    }
  })
}


// 查询列表
export function listLkPostrule(query:any) {
  return request({
    url: '/rule/list',
    method: 'get',
    params: query
  })
}
// 查询详细
export function getLkPostrule(ruleID:any) {
  return request({
    url: '/rule/get',
    method: 'get',
    params: {
      id: ruleID.toString()
    }
  })
}
// 新增
export function addLkPostrule(data:any) {
  return request({
    url: '/rule/add',
    method: 'post',
    data: data
  })
}
// 修改
export function updateLkPostrule(data:any,id:any) {
  return request({
    url: '/rule/edit?id=' + id,
    method: 'put',
    data: data
  })
}
// 删除

export function listLkOdatabase(query:any) {
  return request({
    url: '/extdatabase/list',
    method: 'get',
    params: query
  })
}